package net.jueb.protoServer.message.mapping;

import net.jueb.protoServer.controller.ServiceController;
import net.jueb.protoServer.message.ProtoMessage;
import net.jueb.protoServer.message.ProtoMessage.Message;

/**
 * 针对ProtoMessage.Message的消息映射规则
 * @author Administrator
 *
 */
public class ProtoMessageMapping extends MessageMapping<ProtoMessage.Message>{

	@Override
	public boolean isMatch(Message msg,ServiceController<?> controller) {
		return msg.getMsgId()==controller.getId();
	}

	@Override
	public int getControllerIdByMsg(Message msg) {
		return msg.getMsgId();
	}
}
